/**
 * ch01.console.readline.js
 * 读取命令行输入信息
*/

var readline = require('readline');
//创建一个readline的接口实例

var rl = readline.createInterface({
    input : process.stdin,     //要监听的读取流
    output : process.stdout    //要写入readline的可写流
});
rl.question("What is your name?",function(answer){
    console.log("My name is ",answer);
    rl.close();
})
rl.question("How old are you?",function(answer){
    console.log("I'm ",answer);
    rl.close();
})